#include "addpeople.h"
#include "ui_addpeople.h"
#include<Windows.h>
#include<QListWidget>
addpeople::addpeople(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::addpeople)
{
    ui->setupUi(this);
    renewuitimer->start();

    QListWidgetItem* li=new QListWidgetItem(ui->listWidget);
    li->setSizeHint(QSize(ui->listWidget->width(),40));
    ui->listWidget->setItemWidget(li,item);

    connect(item,&addpeopleitem::addpeopleitemsignals,this,[=](QString addedaccount,QString extrames){
        emit addpeopleItem(addedaccount,extrames);
    });
    connect(renewuitimer,&QTimer::timeout,this,[=](){
        if(peopleexist&&!name.isEmpty()&&!image.isEmpty()) //返回单个用户的信息
        {
            item->init(name,image,ui->lineEdit->text());
        }
        else
        {
            item->init("","","");
        }

    });
}

addpeople::~addpeople()
{
    delete ui;
}

void addpeople::on_lineEdit_textChanged(const QString &arg1)
{
    emit Searchpeople(arg1);

}





